<?php

namespace mpend\modules\team\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\team\models\WorkBookManageSearch;
use mpend\modules\team\models\WorkBookIntrantSearch;

/**
 * 班组记工簿
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DefaultController extends Controller {

    /**
     * @inheritdoc
     */
    public $modelClass = WorkSearch::class;

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET']
        ];
    }

    /**
     * 我管理的
     * @inheritdoc
     */
    public function actionIndex() {
        $model = new WorkBookManageSearch();
        $model->pagesize = false;
        $model->setExtraAttributes([
            'token' => $this->token
        ]);
        return $model->search();
    }

    /**
     * 我加入的
     * @inheritdoc
     */
    public function actionIntrant() {
        $model = new WorkBookIntrantSearch();
        $model->pagesize = false;
        return $model->search();
    }

}
